package com.loongtech.bi.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;

import com.loongtech.bi.manager.system.BiPlatformManager;
import com.loongtech.bi.synch.DataManager;

@Service
public class StartListener implements ApplicationListener<ContextRefreshedEvent>
{
	private boolean			isInit	= false;
	@Autowired
	private BiPlatformManager	platformManager;

	@Override
	public void onApplicationEvent(ContextRefreshedEvent arg0)
	{
		if (isInit)
		{
			return;
		}
		// 初始化
		Log.bi.info("REPORT BI START INIT DATA.");
		DataManager.instance().initData(platformManager);
		
		Log.bi.info("REPORT BI INIT Application end!");
		isInit = true;
	}
}
